package com.cskaoyan.mall.payment.client;

import com.cskaoyan.mall.common.result.Result;
import com.cskaoyan.mall.order.dto.OrderInfoDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient(value = "service-order")
public interface OrderApiClient {

    /**通过订单id获取订单信息*/
    @GetMapping("/api/order/inner/getOrderInfo/{orderId}")
    OrderInfoDTO getOrderInfoDTO(@PathVariable(value = "orderId") Long orderId);

    /**支付成功，需要去订单服务修改订单信息表中的订单状态为已支付*/
    @PostMapping("/api/order/inner/success/{orderId}")
    Result successPay(@PathVariable(value = "orderId") Long orderId);
}
